import request from '@/utils/request'

// 获取组织架构的接口
export function getDepartmentsAPI() {
  return request({
    url: '/company/department'
  })
}

// 获取部门负责人
export function getEmployeeSimpleAPI() {
  return request({
    url: '/sys/user/simple'
  })
}

// 添加部门
export function addDepartmentsAPI(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 根据id获取当前部门详情
export function getDepartDetailAPI(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 更新部门详情
export function updateDepartments(id, data) {
  return request({
    url: `/company/department/${id}`,
    method: 'PUT',
    data
  })
}

// 根据ID删除该部门
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

